import {
  BaseCmd,
  BaseQry,
  BaseView,
  CommonEnum,
} from '@/types/global-business';
import { TableColumnData } from '@arco-design/web-vue/es/table/interface';

export interface WxMaCodeDepositoryExpand {
  maCodeTemplate?: any;
}

export interface WxMaCodeDepositoryView extends BaseView {
  componentAppId?: string;
  appId?: string;
  status?: CommonEnum;
  draftId?: number;
  templateId?: number;
  userVersion?: string;
  userDesc?: string;
  developer?: string;
  draftCreateTime?: Date;
  templateCreateTime?: Date;
  expand?: WxMaCodeDepositoryExpand;
}

export interface WxMaCodeDepositoryListQry extends BaseQry {
  componentAppId?: string;
  keyword?: string;
  draftIdList?: number[];
}

export interface WxMaCodeDepositoryUptCmd extends BaseCmd {
  scene?: any;
  componentAppId?: string;
  id?: number;
}

export const WX_MA_CODE_DEPOSITORY_COLUMNS: TableColumnData[] = [
  {
    title: '序号',
    dataIndex: 'idx',
    width: 60,
    fixed: 'left',
  },
  {
    title: '代码库类型',
    dataIndex: 'type',
    width: 100,
  },
  {
    title: '代码库ID',
    dataIndex: 'draftId', // 草稿ID：draftId｜ 模版ID：templateId
    width: 120,
  },
  {
    title: '版本号',
    dataIndex: 'userVersion',
    width: 120,
  },
  {
    title: '代码描述',
    dataIndex: 'userDesc',
    width: 120,
  },
  {
    title: '开发者',
    dataIndex: 'developer',
    width: 100,
  },
  {
    title: '小程序',
    dataIndex: 'appId', // 小程序AppName｜小程序AppId
    width: 200,
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: 200,
    fixed: 'right',
  },
];
